<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8" />
    <title>String转换</title>
    <script>
        var num = 10;
        var str = String(num);
        console.log(str);
        console.log(typeof str);

        console.log(String(true));
        console.log(String(undefined));
        console.log(String(null));
        console.log(String(NaN));

    </script>
</head>

<body>
</body>